﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Country.aspx.cs" Inherits="Main_Utilities_Country" %>

<%@ Register Src="~/User Controls/PageHeading.ascx" TagName="heading" TagPrefix="acc" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Country</title>
    <link href="../../Styles/accounts.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div class="divmain">
        <div class="divmain">
            <acc:heading ID="pagehead" runat="server" HeadingText="Company" />
        </div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                                <div align="center" style="margin-bottom: 2px; margin-bottom: 2px;">
                        <asp:Label ID="lblMsg" EnableViewState="false" runat="server" Font-Bold="true"></asp:Label></div>

                <asp:Panel ID="PnlAddNew" runat="server" Visible="false">
                    <div align="center" style="margin-top: 5px">
                        <table class="tablecontent" align="center" cellpadding="0" cellspacing="0">
                            <tr>
                                <td class="headtd" colspan="2">
                                    Country
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Country Name <span class="required">*</span>
                                </td>
                                <td style="padding:2px;">
                                    <asp:TextBox ID="txtcountry" MaxLength="35" ToolTip="Country Name" ValidationGroup="Country"
                                        runat="server" CssClass="input"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RFVcountry" runat="server" ErrorMessage="*" ControlToValidate="txtcountry"
                                        ValidationGroup="Country" Display="Dynamic">
                                    </asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    &nbsp;
                                </td>
                                <td>
                                    <asp:Button ID="BtnSubmit" runat="server" CssClass="button" ValidationGroup="Country"
                                        OnClick="BtnSubmit_Click" Text="save" />
                                    &nbsp;<asp:Button ID="BtnCancel" runat="server" CssClass="button" OnClick="BtnCancel_Click"
                                        Text="Cancel" />
                                    &nbsp;
                                </td>
                            </tr>
                        </table>
                    </div>
                </asp:Panel>
                <asp:Panel ID="PnlView" runat="server" Visible="false">
                    <div align="center" style="margin-bottom: 2px; margin-bottom: 2px;">
                        <asp:Label ID="Label1" runat="server" Font-Bold="true"></asp:Label></div>
                    <div align="center" style="width: 90%; margin-left: 5%; margin-right: 5%;">
                        <asp:GridView ID="GrdCountry" Width="40%" runat="server" AutoGenerateColumns="false"
                            CssClass="gridview" PageSize="15" AllowPaging="true" EmptyDataText="No Record Exist!"
                            AlternatingRowStyle-CssClass="gridview_alternate" 
                            PagerStyle-CssClass="pgr" EmptyDataRowStyle-CssClass="emptyrow"
                            RowStyle-CssClass="gridviewitem" DataKeyNames="CountryId" OnRowCancelingEdit="GrdCountry_RowCancelingEdit"
                            OnRowEditing="GrdCountry_RowEditing" 
                            OnRowUpdating="GrdCountry_RowUpdating" 
                            onpageindexchanging="GrdCountry_PageIndexChanging">
                            <Columns>
                                <asp:TemplateField HeaderText="SNo.">
                                    <ItemTemplate>
                                        <%#Container.DataItemIndex+1%>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField HeaderText="Country Name" DataField="CountryName" />
                                <asp:CommandField CausesValidation="false" HeaderText="Edit" EditText="<img src='../../Menu/images/Edit_user.png' alt='Edit'>"
                                    ShowEditButton="true" UpdateText="<img src='../../Menu/images/update.png' alt='Update'>"
                                    CancelText="<img src='../../Menu/images/cancel.png' alt='Cancel'>" ItemStyle-HorizontalAlign="Center" />
                            </Columns>
                              <PagerStyle HorizontalAlign="Right" />
                            <AlternatingRowStyle CssClass="gridview_alternate"></AlternatingRowStyle>
                        </asp:GridView>
                    </div>
                </asp:Panel>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    </form>
</body>
</html>
